//
//  VDDisplayLayout.h
//  PreComposing
//
//  Created by vedon on 14/7/2016.
//  Copyright © 2016 vedon. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "VDSentinel.h"


@class VDDisplayLayer;
@protocol VDDisplayLayerDelegate <NSObject>

@required

- (void)displayAsyncLayout:(VDDisplayLayer *)layer asynchronously:(BOOL)asynchronously;

- (void)cancelDisplayAsyncLayout:(VDDisplayLayer *)layout;


@optional
- (void)drawRect:(CGRect)rect withParameters:(id)parameters;

@end

@interface VDDisplayLayer : CALayer

@property (assign,atomic) BOOL displaysAsynchronously;
@property (assign,nonatomic,getter=isDisplaySuspended) BOOL displaySuspended;

@property (strong,nonatomic,readonly) VDSentinel *displaySentinel;
@property (weak,nonatomic) id<VDDisplayLayerDelegate> displayDelegate;

@property (assign,nonatomic) Class hostLayer;


- (void)forceDisplayImmediately;

- (void)cancelAsyncDisplay;

@end
